import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:qr_code_scanner_ohos/src/types/barcode_format.dart';

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();
  const MethodChannel methodChannel =
  MethodChannel('plugins/qr_capture/method');
  TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger
      .setMockMethodCallHandler(
    methodChannel,
        (message) => null,
  );
  BarcodeFormat barcodeFormat = BarcodeFormat.qrcode;

  test('getAsIn', () async {
    int index = barcodeFormat.asInt();
    expect(index, 11);
  });

  test('getName', () async {
    String name = barcodeFormat.formatName;
    expect(name, 'QR_CODE');
  });
}